using GameFramework.Fsm;
using GameFramework.Procedure;

/// <summary>
/// 资源初始化以及加载
/// </summary>
public class ResourceInitLoadProcedure : GameBaseProcedure
{
    protected override void OnEnter(IFsm<IProcedureManager> procedureOwner)
    {
        base.OnEnter(procedureOwner);
        
        EntityInst.Lua.LoadLua();
    }

    protected override void OnNewUpdate(IFsm<IProcedureManager> procedureOwner, float elapseSeconds, float realElapseSeconds)
    {
        base.OnNewUpdate(procedureOwner, elapseSeconds, realElapseSeconds);

        if (!EntityInst.Lua.InitFlag)
            return;
        
        ChangeState(nameof(LuaProcedure),"InitProcedure");
    }
}